Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Set air block state when breaking a block #239

Closed
wants to merge 1 commit into from

Conversation

duszmox
Copy link
Contributor

@duszmox duszmox commented Nov 7, 2024

  • Fixes the dirt block particles when breaking a block

Description

The server broadcasted a block breaking event with the block state 11. Which meant that it set the new block's (air block)
state to 11, which isn't a valid state for that block.

Testing

Place a block, which is not dirt or grass and then break it, no more dual particles

Checklist

Things need to be done before this Pull Request can be merged.

  • Maybe consider using a constant 0 instead of importing the static var
  • Code is well-formatted and adheres to project style guidelines: cargo fmt
  • Code does not produce any clippy warnings cargo clippy

* Fixes the dirt block particles when breaking a block
@duszmox
Copy link
Contributor Author

duszmox commented Nov 7, 2024

I've imported the BlockState class in case there would be a change in the air block's block state. Not sure if it's that important, maybe a constant 0 would be enough as well

@Snowiiii
Copy link
Owner

Snowiiii commented Nov 7, 2024

These are the sounds and particles being broadcasted. It should be not air, It should be the block broken

@duszmox
Copy link
Contributor Author

duszmox commented Nov 7, 2024

So it should be the old block's state id rather than the new one's?

@Snowiiii
Copy link
Owner

Snowiiii commented Nov 7, 2024

So it should be the old block's state id rather than the new one's?

Of course, Air has no sound and no Breaking Particles. We want to use the ID of the broken block

@Snowiiii Snowiiii closed this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants